//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//********************************************************* 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Microsoft.TridentWordAddIn.Common
{
    public static class ComboBoxExtensions
    {
        /// <summary>
        /// Sets the default selection.
        /// </summary>
        /// <param name="combobox">The combobox.</param>
        public static void SetDefaultSelection(this ComboBox combobox)
        {
            if (combobox.Items.Count == 2)
            {
                combobox.SelectedIndex = 1;
                return;
            }

            combobox.SelectedIndex = 0;            
        }
    }
}
